package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsCartMapper;
import com.qf.pojo.DtsCart;
import com.qf.service.DtsCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@Service
public class DtsCartServiceImpl implements DtsCartService {

    @Autowired
    DtsCartMapper cartMapper;

    @Override
    public int findCountByGid(Integer id) {
        LambdaQueryWrapper<DtsCart> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsCart::getDeleted ,false);
        wrapper.eq(DtsCart::getGoodsId,id);

        return cartMapper.selectCount(wrapper);

    }
}
